<template>
    <div class="clear-fix">
        <article-wrap class="article-wrap" :list="articleList"></article-wrap>
        <index-aside class="aside"></index-aside>
    </div>
</template>

<script>
import articleWrap from '@/components/article-wrap'
import indexAside from '@/components/index-aside'
import { getArticleList } from '@/apis/article.js'
export default {
    name: 'Index',
    components: {
        articleWrap, // 文章组件
        indexAside // 首页侧边栏
    },
    data() {
        return {
            articleList: []
        }
    },
    created() {
        this.getIndexData()
    },
    methods: {
        getIndexData() {
            getArticleList().then(res => {
                this.articleList = this.articleList.concat(res.data)
            })
        }
    }
}
</script>

<style lang="less" scoped>
.article-wrap {
    float: left;
    width: 700px;
}
.aside {
    padding-left: 720px;
    width: 240px;
}
</style>
